<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.mipo.Jfgz" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<%
	String u = null;
	request.setAttribute("jumpUrl", u);// 必须将list列表放入到request中，作为到jsp页面的参数
	
	Jfgz jfgz1 = new Jfgz("1001", "10", "10个积分");
	Jfgz jfgz2 = new Jfgz("1002", "20", "20个积分");
	ArrayList<Jfgz> jifenGZs = new ArrayList<Jfgz>();
	jifenGZs.add(jfgz1);
	jifenGZs.add(jfgz2);
	request.setAttribute("jifenGZs", jifenGZs);// 必须将list列表放入到request中，作为到jsp页面的参数
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jstlUseInJs</title>
<script type="text/javascript">
	<c:if test="${empty jumpUrl}">
		var url = "http://baidu.com";
	</c:if>
	<c:if test="${!empty jumpUrl}">
		var url = "${jumpUrl}";
	</c:if>
	console.log(url);
	//window.location.href = url;
	jifens = [];
	<c:forEach items="${jifenGZs}" var="jfgz">
		jifens[${jfgz.gzId}] = new Array(${jfgz.jifen},"${jfgz.description}");
		console.log(222);
	</c:forEach>
	var description0 = jifens[1001][1];
	var description1 = jifens[1002][1];
	console.log(description0);
	console.log(description1);
	
</script>
</head>
<body>

</body>
</html>